package com.example.tables.dao;

import com.example.tables.bean.TableABean;
import com.example.tables.bean.TableBBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TableBDao {

    @Insert("insert into tableb(a,b,c,d,e,f,aa,bb,cc,dd,ee,aaRight,bbRight,ccRight,ddRight,eeRight) values (#{a},#{b},#{c},#{d},#{e},#{f},#{aa},#{bb},#{cc},#{dd},#{ee},#{aaRight},#{bbRight},#{ccRight},#{ddRight},#{eeRight})")
    int addData(TableBBean tableBBean);

    @Update("update tableb set b = #{b}, c = #{c}, d = #{d}, e = #{e}, f = #{f}, aa = #{aa}, bb = #{bb}, cc = #{cc}, dd = #{dd}, ee = #{ee} , aaRight = #{aaRight} , bbRight = #{bbRight} , ccRight = #{ccRight} , ddRight = #{ddRight} , eeRight = #{eeRight} where A = #{A} ")
    int update(@Param("a")String a,
               @Param("b")String b,
               @Param("c")String c,
               @Param("d")String d,
               @Param("e")String e,
               @Param("f")String f,
               @Param("aa")int aa,
               @Param("bb")int bb,
               @Param("cc")int cc,
               @Param("dd")int dd,
               @Param("ee")int ee,
               @Param("aaRight")int aaRight,
               @Param("bbRight")int bbRight,
               @Param("ccRight")int ccRight,
               @Param("ddRight")int ddRight,
               @Param("eeRight")int eeRight
               );

    @Delete("delete from tableb where a = #{a}")
    int delete(@Param("a")String a);

    @Delete("delete from tableb where c = #{c}")
    int deleteC(@Param("c")String c);

    @Select("select * from tableb")
    List<TableBBean> getAll();




}
